package com.zj.study.utils.validation.validator.not_element_null;


import com.zj.study.utils.validation.annotation.ValidateSupport;
import java.util.Collection;
import org.springframework.lang.NonNull;

/**
 * @author 赵赳
 * @since 2021/9/3 15:42
 */
@ValidateSupport(Collection.class)
public class NotElementNullValidatorForCollection extends
    AbstractNotElementNullValidator<Collection<?>> {

  @Override
  boolean compare(@NonNull Collection<?> value) {
    for (var v : value) {
      if (v == null) {
        return false;
      }
    }
    return true;
  }
}
